﻿using AutoMapper;
using API.Helpers;
namespace API.MappingProfiles
{
    internal class FoodProfile : Profile
    {
        public override string ProfileName
        {
            get { return "Food"; }
        }

        protected override void Configure()
        {
            var mappingExpression = AutoMapperHelper.CreateMap(
                Mapper.CreateMap<EntityModels.Food, Models.Food>()
                    .ForMember("ID", m => m.MapFrom(s => s.FoodId))
                    .ForMember("Name", m => m.MapFrom(s => s.Name))
                    .ForMember("Unit", m => m.MapFrom(s => s.Unit))
                    .ForMember("Price", m => m.MapFrom(s => s.Price))
                    .ForMember("Created", m => m.MapFrom(s => s.Created))
                    );

            mappingExpression.Invoke();
            mappingExpression.Invoke().ReverseMap();
        }
    }
}